package com.jlnk.androidfmc;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.ColorInt;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Tools {

  public static void setSystemBarColorInt(Activity act, @ColorInt int color) {
    Window window = act.getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    window.setStatusBarColor(color);
  }

  public static String getFormattedTimeEvent(Long time) {
    @SuppressLint("SimpleDateFormat")
    SimpleDateFormat newFormat = new SimpleDateFormat("HH:mm:ss");
    return newFormat.format(new Date(time));
  }
}
